﻿using System.Diagnostics.Contracts;

namespace O1
{
    [ContractVerification(true)]
    internal static class Sz
    {
        internal static class CLR
        {
            public const int DateTimeOffset = 16;

            public const int DateTime = 8;

            public const int Decimal = 16;

            public const int Int16 = 2;

            public const int Int32 = 4;

            public const int Int64 = 8;

            public const int Guid = 16;
        }

        internal static class Cell
        {
            public const int PropertyKey = CLR.Int32;

            public const int EdgeType = CLR.Int16;

            public const int CellLocalId = CLR.Int32;

            public const int CellTrunkId = CLR.Int16;

            public const int CellVersion = CLR.Int64 + CLR.Int64;

            public const int Min = CellVersion + CellLocalId + 2;

            public const int CellHeader = CellVersion + CellLocalId;

            public const int CellAddress = CellLocalId + CellTrunkId;

            public const int Edge = EdgeType + CellAddress;
            
            public const int PropStringKeyAndSize = PropertyKey + 1;

            public const int PropStringHash = PropertyKey + CLR.Guid;

            public const int PropDecimal = PropertyKey + CLR.Decimal;

            public const int PropDate = PropertyKey + CLR.DateTime;

            public const int PropDateTime = PropertyKey + CLR.DateTimeOffset;

            public const int PropInt16 = PropertyKey + CLR.Int16;

            public const int PropInt32 = PropertyKey + CLR.Int32;

            public const int PropInt64 = PropertyKey + CLR.Int64;
        }
    }
}
